package net;

import java.io.Serializable;
/*

    This file is part of Logica-Logike.

    Logica-Logike is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation version 3 of the License.

    Logica-Logike is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Logica-Logike.  If not, see <http://www.gnu.org/licenses/>.

 */
/**
 * Usado para enviar la informacion de usuario;
 *
 * @author Jose Martin Rozanec;
 */
public class UserData implements Serializable, Comparable {
    private String names;
    private String surnames;
    private String studentNumber;
    private long ID;

    /**
     * Permite acceder los nombres;
     *
     * @return String;
     */
    public String getNames() {
        return names;
    }

    /**
     * Permite setear los nombres;
     *
     * @param names;
     */
    public void setNames(String names) {
        this.names = names;
    }

    /**
     * Permite acceder los apellidos;
     *
     * @return String;
     */
    public String getSurnames() {
        return surnames;
    }

    /**
     * Permite setear los apellidos;
     *
     * @param surnames;
     */
    public void setSurnames(String surnames) {
        this.surnames = surnames;
    }

    /**
     * Permite acceder el numero de libreta universitaria;
     *
     * @return String;
     */
    public String getStudentNumber() {
        return studentNumber;
    }

    /**
     * Permite setear el numero de libreta universitaria;
     *
     * @param studentNumber;
     */
    public void setStudentNumber(String studentNumber) {
        this.studentNumber = studentNumber;
    }

    /**
     * Permite acceder el ID;
     *
     * @return long;
     */
    public long getID() {
        return ID;
    }

    /**
     * Permite asignar el ID;
     *
     * @param ID;
     */
    public void setID(long ID) {
        this.ID = ID;
    }

    /**
     * Permite obtener una representacion en Strinf de la instancia;
     *
     * @return String;
     */
    public String toString() {
        return "" + names + ", " + surnames + "\n" + studentNumber;
    }

    /**
     * Returns true if the compared objects are considered to be the same, 0 otherwise;
     *
     * @param o;
     * @return integer;
     */
    public int compareTo(Object o) {
        UserData dataToCompare = (UserData) o;
        System.out.println("IDst" + studentNumber);
        System.out.println("IDst2" + dataToCompare.getStudentNumber());
        if (studentNumber.equals(dataToCompare.getStudentNumber())) {
            return 1;
        } else {
            return 0;
        }
    }
}
